import fun
import cv2
import numpy as np

print('''\
                  ************************************************
                         灰度化                    HD
#                        二值化                    EZ
#                        形态学变换                 XD
#                        图像颜色识别替换           SBTH
#                        ROI切割                  ROI
#                        图像旋转                  XZ
#                        图像缩放                  SF
#                        图像校正                  JZ
#                        图像添加水印               SY
#                        图像噪点消除               ZD
#                        图像边缘检测               BY
#                        绘制图像轮廓               LK
#                        对比度增强                JH
#                        模块匹配                  MP
#                        寻找直线                  ZX
#                        寻找圆                    YUAN
#                        图像亮度变换               LD

                  ************************************************''')
if __name__ == '__main__':

    path = input('请输入要处理的图片地址')
    # path = 'lenna.jpg'
    cho = input('要使用的功能')
    if cho == 'HD':
        image_np = fun.hd(path)

    elif cho == 'EZ':
        image_np = fun.ez(path)


    elif cho == 'XD':
        image_np = fun.xb(path)

    elif cho == 'SBTH':
        image_np = fun.sbth(path)

    elif cho == 'ROI':
        image_np = fun.roi(path)

    elif cho == 'XZ':
        image_np = fun.xz(path)

    elif cho == 'SF':
        image_np = fun.sf(path)

    elif cho == 'JZ':
        image_np = fun.jz(path)

    elif cho == 'SY':
        path2 = input('请输入模板')
        image_np = fun.shuiyin(path, path2)

    elif cho == 'ZD':
        image_np = fun.zdxc(path)

    elif cho == 'BY':
        image_np = fun.bianyuan(path)

    elif cho == 'LK':
        image_np = fun.lunkuo(path)

    elif cho == 'JH':
        image_np = fun.duibi(path)

    elif cho == 'MP':
        image_np = fun.mkpp(path)

    elif cho == 'ZX':
        image_np = fun.zx(path)

    elif cho == 'YUAN':
        image_np = fun.yuan(path)

    elif cho == 'LD':
        image_np = fun.ld(path)

    else:
        print("输入错误，请重新输入")

    cv2.imshow('', image_np)
    cv2.imwrite('li.jpg', image_np)
    cv2.waitKey(0)
